import java.util.concurrent.locks.ReentrantLock;

public class emo9 {
    public static void main(String[] args) {
        ReentrantLock reentrantLock = new ReentrantLock(true);
        //一般默认非公平锁,true为公平锁,false为非公平锁
        try{
            //开锁
            reentrantLock.lock();
        }finally {
            //解锁
            reentrantLock.unlock();
        }
    }
}
